package org.ring.common.transport;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;

/**

 * @since 2023-10-30 20:10
 */
public interface Connection {

    boolean isAlive();

    CompletableFuture<Object> send(Message request);

    CompletableFuture<Object> request(Object request, int timeout, ExecutorService executor);

    /*void oneway(Message message);*/

    String connectionId();


    default Object attachment() {
        return null;
    }

    default void attachment(Object attachmentObj) {

    }

}
